from pydantic import Field, BaseModel
from app.core.settings import Settings


class Version(BaseModel):
    api: str = '0.1.1_alpha1'
    support_app_version: str = '0.0.0'


class App(Settings):
    # Application Name
    name: str = Field('FastApi', env='APP_NAME')

    # Application Environment
    env: str = 'production'

    # Application Debug Mode
    debug: bool = False

    url: str = Field('http://localhost', env='APP_URL')

    # Application Timezone
    timezone: str = 'PRC'

    version: Version = Version()

    cors_origins: list = [
        "http://localhost:8000",
        # "https://xz.xjguoyu.cn"
    ]

    class Config:
        env_prefix = 'app_'


app = App()
